package com.hospital.datasource.config;

import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
@Slf4j
public class DataSourceConfiguration {

    @Bean
    public DynamicRoutingDataSource dataSource(){
        DynamicRoutingDataSource dynamicRoutingDataSource=new DynamicRoutingDataSource();
        return dynamicRoutingDataSource;
    }
}
